<template>
  <div>
    <div class="editHeight">
      <div class="dataModel">
        <div class="dataHead">
          <div class="dataHeadTit dataHeadTitop">
            <div>
              <img src="../assets/images/point.png" alt="" />
              户籍信息
            </div>
            <div class="dataEdit">
              <el-button
                icon="el-icon-close"
                circle
                @click="toCloseLayer"
              ></el-button>
            </div>
          </div>
          <img class="splitLine" src="../assets/images/Divider3.png" />
        </div>
        <div class="layerListtop">
          <div class="layerContentinfo">
            <div class="layerContentHead">
              <div class="layerText">户主</div>
              <div class="layerData">
                {{ householder.name }}
              </div>
            </div>
            <div class="layerContentHead">
              <div class="layerText">户籍地址</div>
              <div class="layerData">
                {{ householder.address }}
              </div>
            </div>
            <div class="layerContentHead">
              <div class="layerText">实有人口</div>
              <div class="layerData">{{ infoLayerData.length }}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="dataModel">
        <div class="dataHead" style="height: 40px">
          <div class="dataHeadTit">
            <img src="../assets/images/point.png" alt="" />
            成员信息
          </div>
          <img class="splitLine" src="../assets/images/Divider3.png" />
        </div>
        <div class="layerListinfo">
          <div
            class="layerList1"
            v-for="(item, index) in infoLayerData"
            :key="index"
            @click="toDetail(item)"
          >
            <div>
              <img class="detailAvatar1" src="../assets/images/avatar.png" />
            </div>
            <div class="layerContentinfo">
              <div class="layerContentHead">
                <div class="layerData">{{ item.zpHouseholdName }}</div>
                <div class="Identity">{{ item.zpHouseholdIdentity }}</div>
              </div>
              <div
                class="layerContentTip"
                v-if="item.zpHouseholdTips.length > 1"
              >
                <div
                  class="infoTips"
                  v-for="(obj, inx) in item.zpHouseholdTips"
                  :key="inx"
                >
                  <div
                    class="tipText"
                    :class="[
                      obj == '吸毒人员' ||
                      obj == '肇事肇祸精神病人' ||
                      obj == '上访人员' ||
                      obj == '邪教人员' ||
                      obj == '重点人员' ||
                      obj == '酗酒滋事' ||
                      obj == '治安危险分子'
                        ? 'danger'
                        : '',
                      obj == '问题青少年' ||
                      obj == '留守妇女' ||
                      obj == '孤寡老人'
                        ? 'normal'
                        : '',
                      obj == '风险家庭' || obj == '前科人员' ? 'commonly' : '',
                    ]"
                  >
                    {{ obj }}
                  </div>
                </div>
              </div>
              <div class="layerContentTip" v-else>
                <div class="State">{{ item.zpHouseholdState }}</div>
              </div>
              <div class="layerContentHead">
                <div class="layerData">
                  {{ item.zpHouseholdSex == 1 ? "男" : "女" }}
                  {{ item.zpHouseholdAge }}岁
                </div>
              </div>
              <div class="layerContentHead">
                <div class="layerData">{{ item.zpHouseholdPhone }}</div>
              </div>
            </div>
            <div>
              <i class="iconfont icon-xiangyou1"></i>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Basicdata from "./data";
export default {
  name: "InfoLayer",
  props: {
    infoLayerData: {
      type: Array,
      default: () => [],
    },
    householder: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      dataDetail: Basicdata.dataDetail,
      floorDetail: Basicdata.floorDetail,
      detailEdit: Basicdata.detailEdit,
      classname: "",
      tips: ["困难家庭", "整户无劳力", " 就业帮扶"],
    };
  },
  created() {},
  mounted() {
    console.log("人员信息", this.householder);
    // this.infoLayerData.forEach((item) => {
    //   console.log("AAAA", item);
    // });
    // this.processing();
  },
  methods: {
    toCloseLayer() {
      this.$emit("toCloseLayer", false);
    },
    processing() {
      console.log("infoLayerData", this.infoLayerData);
    },
    toDetail(item) {
      this.$emit("toDetail", item);
    },
  },
};
</script>

<style lang="scss" scoped>
.editHeight {
  height: 665px;
  width: 488px;
  background: url("../assets/images/infoBg.png");
  background-repeat: no-repeat;
  color: #fff;
  .layerListtop {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    margin: 0 30px;
    padding: 20px 0 10px 0;
    .layerContentinfo {
      width: 100%;
      .layerContentHead {
        display: flex;
        justify-content: flex-start;
        // align-items: center;
        margin-top: 5px;
        .layerText {
          text-align: right;
          color: #d1faff;
          width: 70px;
          margin-right: 12px;
        }
        .layerData {
          // width: 345px;
        }
      }
    }
  }
  .layerList1 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    margin: 0 30px;
    padding: 20px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    .detailAvatar1 {
      width: 90px;
      height: 120px;
      // background: #0178fc;
      vertical-align: top;
      border-radius: 10px;
      margin-right: 25px;
    }
    .layerContentinfo {
      width: 100%;
      .layerContentTip {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        .infoTips {
          display: flex;
          justify-content: flex-start;
          .tipText {
            padding: 5px;
            margin-right: 5px;
            border-radius: 5px;
            margin-bottom: 5px;
          }
        }
      }
      .layerContentHead {
        display: flex;
        justify-content: flex-start;
        // align-items: center;
        margin-bottom: 5px;
        .layerText {
          text-align: right;
          color: #d1faff;
          width: 70px;
          margin-right: 12px;
        }
        .layerData {
          margin-right: 15px;
        }
      }
    }
  }
  .Identity {
    padding: 5px;
    margin-right: 15px;
    background: #004b79;
    border-radius: 5px;
  }
  .State {
    padding: 5px;
    margin-right: 15px;
    background: #49a942;
    border-radius: 5px;
    margin-bottom: 5px;
  }
  .dataModel {
    cursor: default;
    margin-bottom: 10px;
    .dataHead {
      text-align: center;
      font-size: 22px;
      font-weight: 400;
      height: 62px;
      .dataHeadTit {
        text-align: left;
        margin: 0 30px 20px 30px;
      }
      .dataHeadTitop {
        margin: 10px 30px 20px 30px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 0px 0px 0px;
      }
      .splitLine {
        position: relative;
        top: -28px;
      }
    }
  }
}
.layerListinfo {
  height: 425px;
  overflow-y: auto;
}
.layerListinfo::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
/*滚动条里面小方块样式*/
.layerListinfo::-webkit-scrollbar-thumb {
  border-radius: 100px;
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.3);
}
/*滚动条里面轨道样式*/
.layerListinfo::-webkit-scrollbar-track {
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: transparent;
}
.editHeight::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
/*滚动条里面小方块样式*/
.editHeight::-webkit-scrollbar-thumb {
  border-radius: 100px;
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.3);
}
/*滚动条里面轨道样式*/
.editHeight::-webkit-scrollbar-track {
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: transparent;
}
.icon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dataEdit {
  display: flex;
  justify-content: flex-end;
}
.editorContent {
  font-size: 16px;
  margin-left: 30px;
  margin-right: -3px;
  width: 432px;
  overflow-y: auto;
  overflow-x: hidden;
  .edittxt {
    max-height: 270px;
    width: 414px;
    // overflow-y: auto;
    // overflow-x: hidden;
  }
}
.edittxt img {
  height: 150px;
}
.editorContent::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
/*滚动条里面小方块样式*/
.editorContent::-webkit-scrollbar-thumb {
  border-radius: 100px;
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.3);
}
/*滚动条里面轨道样式*/
.editorContent::-webkit-scrollbar-track {
  // -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: transparent;
}
.danger {
  background: #dd0a35;
}
.commonly {
  background: #e78900;
}
.normal {
  background: #d9cf5c;
}
</style>
